<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<h1><fmt:message key="booking.search.title"/></h1>

	<form action="${flowExecutionUrl}">
	<input type="hidden" name="execution" value="${flowExecutionKey}">
    <fieldset>
    	<legend>Choix de la ville</legend>
        <div class="form-row">
            <label for="city"><fmt:message key="booking.search.city"/>:</label>
            <c:choose>
            <c:when test="${!empty tripSearch.city}">
            <span class="input"><input type="text" value="${tripSearch.city}" name="city" /></span>
            </c:when>
            <c:otherwise>
            	<span class="input"><input type="text" value="" name="city" /></span>
            </c:otherwise>
            </c:choose>
            
        </div>
        <div class="form-buttons">
            <div class="button">
                <input type="submit" id="search" name="_eventId_searchTrip" value="<fmt:message key="button.search"/>"/>&#160;
            </div>    
        </div>
    </fieldset>
    </form>
    
    <c:if test="${! empty tripSearch.searchResults}">
	    <table>
	    	<ul>
		    <c:forEach items="${tripSearch.searchResults}" var="result">
		    	<li><a href="${flowExecutionUrl}&_eventId=selectedCity&city=${result.city}">${result.city}</a></li>
		    </c:forEach> 
		    </ul>
	    </table>
    </c:if>
